<% layout('/layouts/default.html', {title: '考核任务指标表-指标信息管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${dcSupExamQuotaInfo}" action="${ctx}/quota/dcSupExamQuotaInfo/save?quotaGroup=1" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('考核年度')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:hidden path="isNewRecord"/>
								<#form:hidden path="id" />
								<#form:select path="examYear" readonly="true" items="${yearList}" blankOption="true" data-placeholder="请选择" itemLabel="yearLabel" itemValue="yearValue" class="form-control width-120" defaultValue="${currentYear}"/>

								<#form:hidden path="quotaId" class="form-control"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('指标类别')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="quotaType" dictType="dc_quotaType" blankOption="true"  data-placeholder="请选择" class="form-control required" defaultValue="1" readonly="true"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('序号')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="sortNum" class="form-control digits" maxlength="5" placeholder="请输入数字" min="1"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('单位')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="quotaUnit" maxlength="255" class="form-control " placeholder="例：亿元、万元、个、条、家、项、户等;若无则不填"/>
							</div>
						</div>
					</div>

				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> ${text('目标内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="quotaContent" rows="4" maxlength="255" class="form-control required" placeholder="请输入目标内容或监测指标；例：争取国债和专项资金"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">

					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('权数')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="quotaWeight" class="form-control  required"  maxlength="4" max="150" onkeyup="num(this)" placeholder="请输入数字"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('本年度目标')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="currentYaerGoal" maxlength="255" class="form-control required" placeholder="例：完成"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row" style="display: none">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required ">*</span> ${text('被考核单位')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-2">
								<#form:treeselect  title="${text('被考核单位')}"
								path="exameOrgs" labelValue="${officeName!}" labelPath="exameOrgNames"
								url="${ctx}/sys/office/treeData" type="text"
								class="required" isReturnValue="false" allowClear="true" canSelectRoot="true" canSelectParent="true"
								returnFullName="false" checkbox="true" chkboxType="{'Y':'','N':''}"
								placeholder="请选择被考核单位"/>
							</div>
						</div>
					</div>
				</div>


				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('考核方式')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="assessMethod" dictType="dc_exam_assessment" blankOption="true"   class="form-control " />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('上一年度目标任务')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="lastYaerGoal" maxlength="255" class="form-control " placeholder="例：完成、量化任务数"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('上一年度完成情况')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="lastYearComplete" maxlength="255" class="form-control " placeholder="定性指标填写“完成”；定量指标填写：量化任务数；"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> ${text('备注')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="remarks" dictType="dc_exam_remarks" blankOption="true"  data-placeholder="请选择" class="form-control required" />
							</div>
						</div>
					</div>
				</div>


				</div>


			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-5 col-sm-10">
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('提 交')}</button>&nbsp;
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});

//强制最多输入2位小数
function num(obj){
	obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
	obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
	obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
	obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
	obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
}

</script>